<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    // 找出字符串中的 555 截取出来

    //声明字符串
    let str = 'JS5211314你知道么555啦啦啦';
    //正向断言   找出 啦啦啦 前面的数字
    const reg = /\d+(?=啦)/;
    const result = reg.exec(str); console.log(result);

    //反向断言     找出 么 后面的数字
    const reg2 = /(?<=么)\d+/;
    const result2 = reg2.exec(str);
    console.log(result2);
  </script>
</body>

</html>